﻿#pragma once

#include "ComponentBase.h"

class SafeLocker : public ComponentBase
{
	Q_OBJECT

public:
	SafeLocker(QObject *parent);
	~SafeLocker();

	// 组件初始化处理函数
	virtual int ComponentInit() override;
	/*自检接口*/
	virtual bool ComponentCheckSelfState() override;
	/*复位接口*/
	virtual bool ComponentSelfReset() override;

	virtual void ResponseSystemState(int state) override;

private:
	bool OpenLocker();
	bool CloseLocker();

	int OnReciverDiInfo(const QByteArray& info);
	void OnReciverEnterEvent(int ev);
private:
	int m_infoDi = -1;
	int m_setDo = -1;

	bool m_state = false;
	ComponentBase* m_rob = nullptr;
};
